﻿namespace codeCounter;
using codeCounter.Converters;

public partial class App : Application
{
	public App()
	{
		InitializeComponent();

		MainPage = new AppShell();
	}
	protected override Window CreateWindow(IActivationState activationState)
	{
		var window = base.CreateWindow(activationState);
    
		// 设置窗口初始尺寸
		window.Width = 700;  // 可以根据需要调整宽度
		window.Height = 800;
		// 获取主显示器尺寸并将窗口居中
		var displayInfo = DeviceDisplay.MainDisplayInfo;
		double screenWidth = displayInfo.Width / displayInfo.Density;
		double screenHeight = displayInfo.Height / displayInfo.Density;
    
		window.X = (screenWidth - window.Width) / 2;
		window.Y = (screenHeight - window.Height) / 2 - 70;
		return window;
	}
}
